Skip to content

Conversation

@agibson-godaddy
Copy link
Contributor

@agibson-godaddy agibson-godaddy commented Jan 21, 2026

Issue: https://godaddy-corp.atlassian.net/browse/MWC-17960

Summary

This replaces the unmaintained gulp-sass-lint with gulp-postcss / stylelint. It also adds a lint config, which disables a ton of rules just to avoid suddenly switching to this method and ending up with a ton of warnings you didn't have before. IMO it's up to individual plugins to override these lint rules (supported).

To override:

Create a new .stylelintrc.json file in plugin directory with desired rules.

Update sake config:

  // sake.config.js
  module.exports = {
    tasks: {
        lint: {
            stylelintConfigFile: '.stylelintrc.json' // relative to current directory
        }
    }
    // ... other sake configuration
  }

This change also supports fixing lint errors with a --fix flag.

QA

  1. Use a plugin that has SCSS - https://github.com/gdcorp-partners/woocommerce-customer-order-csv-export/pull/107
  2. Use this development version of Sake
  3. In the plugin's directory, run sake lint:scss
    • No fatal errors (lint errors are okay)
  4. Run sake compile:scss
    • No errors
    • CSS renders okay
  5. Run sake lint:scss --fix -- QA for this step onwards only works if you had at least 1 lint error, which csv export does
    • No errors
  6. Run git status
    • You see modified scss files
  7. Run git diff
    • Changes make sense

Here's an output of the changes from woocommerce-customer-order-csv-export :

 sake lint:scss
[12:29:24] Using gulpfile ~/Projects/sake/gulpfile.js
[12:29:24] Starting 'lint:scss'...
[12:29:24] Fixing lint errors...
[12:29:25] gulp-postcss: admin/wc-customer-order-csv-export-admin.scss
stylelint: /home/agibson/www/plugins/wp-content/plugins/woocommerce-customer-order-csv-export/assets/css/admin/wc-customer-order-csv-export-admin.scss:24:2: Expected double colon pseudo-element notation (selector-pseudo-element-colon-notation)
stylelint: /home/agibson/www/plugins/wp-content/plugins/woocommerce-customer-order-csv-export/assets/css/admin/wc-customer-order-csv-export-admin.scss:24:2: Expected double colon pseudo-element notation (selector-pseudo-element-colon-notation)
stylelint: /home/agibson/www/plugins/wp-content/plugins/woocommerce-customer-order-csv-export/assets/css/admin/wc-customer-order-csv-export-admin.scss:102:3: Expected double colon pseudo-element notation (selector-pseudo-element-colon-notation)
stylelint: /home/agibson/www/plugins/wp-content/plugins/woocommerce-customer-order-csv-export/assets/css/admin/wc-customer-order-csv-export-admin.scss:127:4: Expected double colon pseudo-element notation (selector-pseudo-element-colon-notation)
[[[truncated]]]
[12:29:25] Finished 'lint:scss' after 609 ms
$ git status
On branch address-sass-compiling-errors
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   assets/css/admin/wc-customer-order-csv-export-admin.scss

and $git diff (truncated)

diff --git a/assets/css/admin/wc-customer-order-csv-export-admin.scss b/assets/css/admin/wc-customer-order-csv-export-admin.scss
index a78f648..f8a093e 100644
--- a/assets/css/admin/wc-customer-order-csv-export-admin.scss
+++ b/assets/css/admin/wc-customer-order-csv-export-admin.scss
@@ -21,8 +21,8 @@ $blue:          #2ea2cc;
                width:2em;
        }

-       .download_to_csv:after,
-       .download_to_xml:after {
+       .download_to_csv::after,
+       .download_to_xml::after {
                @include mixins.dashicon( "\f316" );
        }
 }
@@ -99,7 +99,7 @@ $blue:          #2ea2cc;
        .transfer_status_head {
                @include mixins.dashicon-ir;
                line-height: 1;
-               &:after {
+               &::after {
                        @include mixins.dashicon( "\f317" );
                }
        }
@@ -124,7 +124,7 @@ $blue:          #2ea2cc;
                        font-size: 1.4em;
                        margin: 0 auto;

-                       &:after {
+                       &::after {
                                font-family: WooCommerce;
                                speak: none;
                                font-weight: 400;
@@ -143,28 +143,28 @@ $blue:          #2ea2cc;
                        }
                }

-               mark.queued:after {
+               mark.queued::after {
                        content: "\e012";
                        color: $orange;
                }

-               mark.completed:after {
+               mark.completed::after {
                        content: "\e015";
                        color: $blue;
                }

-               mark.failed:after {
+               mark.failed::after {
                        content: "\e013";
                        color: $red;
                }

After merge

Base automatically changed from mwc-17961 to master January 30, 2026 12:40
An error occurred while trying to automatically change base from mwc-17961 to master January 30, 2026 12:40
@agibson-godaddy agibson-godaddy marked this pull request as ready for review January 30, 2026 14:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the unmaintained gulp-sass-lint package with a modern stylelint-based linting solution using gulp-postcss and stylelint. The change includes a default configuration that disables many rules to maintain compatibility with existing projects while allowing individual plugins to override settings via their own .stylelintrc.json files.

Changes:

  • Removed dependency on deprecated gulp-sass-lint and added stylelint, postcss-scss, and related packages
  • Updated the SCSS linting task to use postcss pipeline with stylelint
  • Added a default stylelint configuration with many rules disabled for backward compatibility

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
tasks/lint.js Updated lintScssTask to use postcss/stylelint instead of gulp-sass-lint, with support for custom config files
package.json Removed gulp-sass-lint dependency and added stylelint, postcss-scss, and stylelint-config-standard-scss
lib/lintfiles/.stylelintrc.json Added default stylelint configuration extending standard SCSS config with many rules disabled

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@agibson-godaddy agibson-godaddy self-assigned this Feb 2, 2026
Copy link
Contributor

@nikolas4175-godaddy nikolas4175-godaddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments on things we could clean up, but no major concerns. Completed QA on Memberships without issue, and I also confirmed I was able to override rules with the addition of .stylelintrc.json file 👍 Love having a --fix command! 🚀

Copy link
Contributor

@nikolas4175-godaddy nikolas4175-godaddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All questions addressed 👍

@agibson-godaddy agibson-godaddy merged commit f5abc74 into master Feb 4, 2026
@agibson-godaddy agibson-godaddy deleted the mwc-17960 branch February 4, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants